<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>九九乘法表</title>
</head>
<body>
    
</body>
<script>
    for(var i = 1 ; i < 10 ; i++){
        for(var j = 0 ; j < i ; j++){
            var sum = i * (j + 1);
            if( sum < 10){
                document.write(i + "" + "*" + "" + (j + 1) + "=" + sum + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
            }else{
                document.write(i + "" + "*" + "" + (j + 1) + "=" + sum + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
            }
        }
        document.write("<br>");
        document.write("<br>");

    }





    // 九九乘法表到写
    // for(var i = 9 ; i > 0 ; i--){
    //     for(var j = 0 ; j < i ; j++){
    //         var sum = i * (j + 1);
    //         if( sum < 10){
    //             document.write(i + "" + "*" + "" + (j + 1) + "=" + sum + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    //         }else{
    //             document.write(i + "" + "*" + "" + (j + 1) + "=" + sum + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    //         }
    //     }
    //     document.write("<br>");
    //     document.write("<br>");
    // }
</script>
</html>